/*
 * =====================================================================================
 *
 *       Filename:  Thread.h
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  05/31/12 17:55:24
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  jjlee (), jjlee@nhn.com
 *   Organization:  
 *
 * =====================================================================================
 */

#ifndef __THREAD_H__
#define __THREAD_H__

#include <pthread.h>
#include <Runnable.h>

class Thread:public Runnable {
public:
	Thread();
	Thread(Runnable *runable);
	virtual ~Thread();

	void start();
	int wait();
	void exit(int ret);
	static void getThreadId();
	static void yield();
	static pthread_t getId();
	
	virtual void run();

private:
	Runnable* runnable;
	pthread_t thread_id;
	int exit_code;
	static void* main(void* instance);
};

#endif

